package com.rainman.simpleredis.demo.mq_worker;

import com.rainman.simpleredis.core.SimpleRedis;
import com.rainman.simpleredis.core.simplemq.SimpleMqWorkerInterface;
import com.rainman.simpleredis.core.simplemq.WorkerReturn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * MQ消费者
 *
 */
@Component
public class Worker1 implements SimpleMqWorkerInterface {

    @Autowired
    SimpleRedis simpleRedis;

    @Override
    public WorkerReturn doWork(String targetType,String targetId, String msgValue) {
        System.out.println(new Date()+"Worker1 doWork"+targetId+" "+msgValue);
        return null;
    }

    @Override
    public Boolean matchTargetType(String targetType) {
        return targetType.equals("100");
    }
}
